home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9207.ARJ
/
1007055A
< prev
next >
Wrap
Text File
|
1992-06-03
|
266b
|
14 lines
istream &operator>>(istream &is, rational &r)
{
char lp, slash, rp;
long n, d;
is >> lp >> n >> slash >> d >> rp;
if (is && lp == '(' && slash == '/' && rp == ')')
r = rational(n, d);
else if (is.good())
// indicate a failure
return is;
}